package com.piggy.logi.sys.api;

import com.piggy.common.core.constant.SecurityConstants;
import com.piggy.common.core.constant.ServiceNameConstants;
import com.piggy.common.core.domain.R;
import com.piggy.logi.sys.api.bo.LogiSysMenuBo;
import com.piggy.logi.sys.api.factory.RemoteLogiMenuFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 角色服务
 *
 * @author shark
 */
@FeignClient(contextId = "remoteLogiMenuService", value = ServiceNameConstants.SYSTEM_LOGI_SERVICE, fallbackFactory = RemoteLogiMenuFallbackFactory.class)
public interface RemoteLogiMenuService {

    @GetMapping("/logi/menu/button/{userId}")
    List<Long> getButtonIdsByUserId(@PathVariable(value = "userId") Long userId , @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @PostMapping("/logi/menu/innerRemove/{menuId}")
    public R innerRemove(@PathVariable("menuId") Long menuId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @PostMapping("/logi/menu/innerEdit")
    public R innerEdit(@Validated @RequestBody LogiSysMenuBo menu, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @PostMapping("/logi/menu/innerAdd")
    public R innerAdd(@Validated @RequestBody LogiSysMenuBo menu, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @PostMapping("/logi/menu/innerTreeselect")
    public R innerTreeselect(@RequestBody LogiSysMenuBo menu, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @GetMapping(value = "/logi/menu/inner/{menuId}")
    public R innerInfo(@PathVariable("menuId") Long menuId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @PostMapping("/logi/menu/innerList")
    public R innerList(@RequestBody LogiSysMenuBo menu, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

}
